跳到主要内容

Caddy 2 简易使用

#说明

  1. 下载 并放到PATH中

  2. 编写Caddyfile



#域名
arick.top {

#静态文件 index.html
#file_server browse

#反向代理地址
reverse_proxy 127.0.0.1:9000
}

#监听端口
:2016 {

reverse_proxy 127.0.0.1:9001
}
#Make sure to reload Caddy (or stop and start it again) when you change the Caddyfile.

#Now you can access the proxy at localhost:2016.


:8080 {
respond "I am 8080"
}

:8081 {
respond "I am 8081"
}


  1. 进入 配置文件目录 运行 服务 命令 caddy run caddy start caddy reload